package com.jic.market.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * description: ResourceEnum
 * date: 2020/2/29 17:44
 * author: wangys
 * version: 1.0
 */
@Getter
@AllArgsConstructor
public enum ResourceEnum {

    MARKET_FULL("FULL", "template/","FULL.xlsx"),
    MARKET_PRESELL("PRESELL", "template/","PRESELL.xlsx"),
    TEMPLATE_GOODS("TEMPLATE_GOODS", "template/","TEMPLATE_GOODS.xls"),

//    phpCodecDemo("phpCodecDemo", "template","napi-v1-php.zip"),
    ;


    private String code;
    private String path;
    private String name;

    public static ResourceEnum find(String code) {
        if (code == null) {
            return null;
        }
        for (ResourceEnum r : values()) {
            if (code.equalsIgnoreCase(r.getCode())) {
                return r;
            }
        }
        return null;
    }

}
